﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using MSWMDMLib;
using MS.WindowsAPICodePack.Internal;

namespace FireZone.NativeWMDMInteface
{
    [ComImport, Guid("3F5E95C0-0F43-4ed4-93D2-C89A45D59B81"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMNotification
    {
        void WMDMMessage(WMDMDeviceNotification dwMessageType, [MarshalAs(UnmanagedType.LPWStr)] String pwszCanonicalName);
    };

    [ComImport, Guid("923E5249-8731-4c5b-9B1C-B8B60B6E46AF"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDeviceManager2 : IWMDeviceManager
    {
        new void EnumDevices(out WMDMDeviceEnum ppEnumDevice);
        new void GetDeviceCount(out uint pdwCount);
        new void GetRevision(out uint pdwRevision);
        void GetDeviceFromCanonicalName(String pwszCanonicalName, out WMDMDevice ppDevice);
        void EnumDevices2(out WMDMDeviceEnum ppEnumDevice);
        void Reinitialize();
    }

    [ComImport, Guid("af185c41-100d-46ed-be2e-9ce8c44594ef"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDeviceManager3 : IWMDeviceManager2
    {
        new void EnumDevices(out WMDMDeviceEnum ppEnumDevice);
        new void GetDeviceCount(out uint pdwCount);
        new void GetRevision(out uint pdwRevision);
        new void GetDeviceFromCanonicalName(String pwszCanonicalName, out WMDMDevice ppDevice);
        new void EnumDevices2(out WMDMDeviceEnum ppEnumDevice);
        new void Reinitialize();
        [PreserveSig]
        int SetDeviceEnumPreference(WMDMDeviceEnumPreference dwEnumPref);
    }

    internal struct _WAVEFORMATEX
    {
        ushort wFormatTag;
        ushort nChannels;
        uint nSamplesPerSec;
        uint nAvgBytesPerSec;
        ushort nBlockAlign;
        ushort wBitsPerSample;
        ushort cbSize;
    };

    internal struct _BITMAPINFOHEADER
    {
        uint biSize;
        int biWidth;
        int biHeight;
        ushort biPlanes;
        ushort biBitCount;
        uint biCompression;
        uint biSizeImage;
        int biXPelsPerMeter;
        int biYPelsPerMeter;
        uint biClrUsed;
        uint biClrImportant;
    };

    internal struct RECT
    {
        int left;
        int top;
        int right;
        int bottom;
    };

    internal struct _VIDEOINFOHEADER
    {
        RECT rcSource;
        RECT rcTarget;
        uint dwBitRate;
        uint dwBitErrorRate;
        long AvgTimePerFrame;
        _BITMAPINFOHEADER bmiHeader;
    } 	;

    internal struct WMFILECAPABILITIES
    {
        String pwszMimeType;
        uint dwReserved;
    } 	;

    internal struct CAUUID
    {
        uint cElems;
        IntPtr pElems;
    };

    [ComImport, Guid("B196B28B-BAB4-101A-B69C-00AA00341D07"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface ISpecifyPropertyPages
    {
        void GetPages(out CAUUID pPages);
    };

    [ComImport, Guid("E34F3D37-9D67-4fc1-9252-62D28B2F8B55"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMDevice2 : IWMDMDevice
    {
        new void GetName(StringBuilder pwszName, uint nMaxChars);
        new void GetManufacturer(StringBuilder pwszName, uint nMaxChars);
        new void GetVersion(out uint pdwVersion);
        new void GetType(out uint pdwType);
        new void GetSerialNumber(out __WMDMID pSerialNumber, [MarshalAs(UnmanagedType.LPArray, SizeConst = 8)] byte[] abMac);
        new void GetPowerSource(out uint pdwPowerSource, out uint pdwPercentRemaining);
        new void GetStatus(out uint pdwStatus);
        new void GetDeviceIcon(out uint hIcon);
        new void EnumStorage(out WMDMStorageEnum ppEnumStorage);
        new void GetFormatSupport(IntPtr ppFormatEx, out uint pnFormatCount, IntPtr pppwszMimeType, out uint pnMimeTypeCount);
        new void SendOpaqueCommand(ref __OPAQUECOMMAND pCommand);

        void GetStorage(String pszStorageName, out WMDMStorage ppStorage);
        void GetFormatSupport2(uint dwFlags, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]out _WAVEFORMATEX[] ppAudioFormatEx, out uint pnAudioFormatCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] out _VIDEOINFOHEADER[] ppVideoFormatEx, out uint pnVideoFormatCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 6)] out WMFILECAPABILITIES[] ppFileType, out uint pnFileTypeCount);
        void GetSpecifyPropertyPages(out ISpecifyPropertyPages ppSpecifyPropPages, out IntPtr pppUnknowns, out uint pcUnks);
        void GetCanonicalName(StringBuilder pwszPnPName, uint nMaxChars);
    };


    internal struct WMDM_FORMAT_CAPABILITY
    {
        uint nPropConfig;
        IntPtr pConfigs;
    };

    internal struct WMDMRIGHTS
    {
        uint cbSize;
        uint dwContentType;
        uint fuFlags;
        uint fuRights;
        uint dwAppSec;
        uint dwPlaybackCount;
        _WMDMDATETIME ExpirationDate;
    };



    [ComImport, Guid("6c03e4fe-05db-4dda-9e3c-06233a6d5d65"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMDevice3 : IWMDMDevice2
    {
        new void GetName(StringBuilder pwszName, uint nMaxChars);
        new void GetManufacturer(StringBuilder pwszName, uint nMaxChars);
        new void GetVersion(out uint pdwVersion);
        new void GetType(out uint pdwType);
        new void GetSerialNumber(out __WMDMID pSerialNumber, [MarshalAs(UnmanagedType.LPArray, SizeConst = 8)] byte[] abMac);
        new void GetPowerSource(out uint pdwPowerSource, out uint pdwPercentRemaining);
        new void GetStatus(out uint pdwStatus);
        new void GetDeviceIcon(out uint hIcon);
        new void EnumStorage(out WMDMStorageEnum ppEnumStorage);
        new void GetFormatSupport(IntPtr ppFormatEx, out uint pnFormatCount, IntPtr pppwszMimeType, out uint pnMimeTypeCount);
        new void SendOpaqueCommand(ref __OPAQUECOMMAND pCommand);

        new void GetStorage(String pszStorageName, out WMDMStorage ppStorage);
        new void GetFormatSupport2(uint dwFlags, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]out _WAVEFORMATEX[] ppAudioFormatEx, out uint pnAudioFormatCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] out _VIDEOINFOHEADER[] ppVideoFormatEx, out uint pnVideoFormatCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 6)] out WMFILECAPABILITIES[] ppFileType, out uint pnFileTypeCount);
        new void GetSpecifyPropertyPages(out ISpecifyPropertyPages ppSpecifyPropPages, out IntPtr pppUnknowns, out uint pcUnks);
        new void GetCanonicalName(StringBuilder pwszPnPName, uint nMaxChars);

        void GetProperty([In]String pwszPropName, [Out] PropVariant propVar);
        void SetProperty(String pwszPropName, ref PropVariant pValue);
        void GetFormatCapability(WMDM_FORMATCODE format, out WMDM_FORMAT_CAPABILITY pFormatSupport);
        void DeviceIoControl(uint dwIoControlCode, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]byte[] lpInBuffer, uint nInBufferSize, out byte[] lpOutBuffer, out uint pnOutBufferSize);
        void FindStorage(WMDM_FIND_SCOPE findScope, String pwszUniqueID, out WMDMStorage ppStorage);
    };

    [ComImport, Guid("1ED5A144-5CD5-4683-9EFF-72CBDB2D9533"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMStorage2 : IWMDMStorage
    {
        new void SetAttributes(uint dwAttributes, ref _tWAVEFORMATEX pFormat);
        new void GetStorageGlobals(out WMDMStorageGlobal ppStorageGlobals);
        new void GetAttributes(out uint pdwAttributes, ref _tWAVEFORMATEX pFormat);
        new void GetName(StringBuilder pwszName, uint nMaxChars);
        new void GetDate(out _WMDMDATETIME pDateTimeUTC);
        new void GetSize(out uint pdwSizeLow, out uint pdwSizeHigh);
        new void GetRights(IntPtr ppRights, out uint pnRightsCount, [MarshalAs(UnmanagedType.LPArray)]byte[] abMac);
        new void EnumStorage(out WMDMStorageEnum pEnumStorage);
        new void SendOpaqueCommand(ref __OPAQUECOMMAND pCommand);

        void GetStorage(String pszStorageName, out WMDMStorage ppStorage);
        void SetAttributes2(WMDM_STORAGE_ATTR dwAttributes, uint dwAttributesEx, ref _WAVEFORMATEX pFormat, ref _VIDEOINFOHEADER pVideoFormat);
        void GetAttributes2(out WMDM_STORAGE_ATTR pdwAttributes, out uint pdwAttributesEx, out _WAVEFORMATEX pAudioFormat, out _VIDEOINFOHEADER pVideoFormat);
    };


    // WMDM Seek Flags
    [StructLayout(LayoutKind.Sequential)]
    internal struct WMDMMetadataView
    {
        [MarshalAs(UnmanagedType.LPWStr)]
        String pwszViewName;
        uint nDepth;
        [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)]
        String[] ppwszTags;
    } 	;

    [ComImport, Guid("EC3B0663-0951-460a-9A80-0DCEED3C043C"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMMetaData
    {
        void AddItem(WMDM_TAG_DATATYPE Type, String pwszTagName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] byte[] pValue, int iLength);
        void QueryByName(String pwszTagName, out WMDM_TAG_DATATYPE pType, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] out byte[] pValue, out int pcbLength);
        void QueryByIndex(uint iIndex, out String ppwszName, out WMDM_TAG_DATATYPE pType, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] out byte[] ppValue, out int pcbLength);
        void GetItemCount(out int iCount);
    };

    [ComImport, Guid("1DCB3A0C-33ED-11d3-8470-00C04F79DBC0"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMProgress
    {
        void Begin(int dwEstimatedTicks);
        void Progress(int dwTranspiredTicks);
        void End();
    };

    [ComImport, Guid("3A43F550-B383-4e92-B04A-E6BBC660FEFC"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMProgress2 : IWMDMProgress
    {
        new void Begin(int dwEstimatedTicks);
        new void Progress(int dwTranspiredTicks);
        new void End();

        void End2(int hrCompletionCode);
    };

    [ComImport, Guid("21DE01CB-3BB4-4929-B21A-17AF3F80F658"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMProgress3 : IWMDMProgress2
    {
        new void Begin(int dwEstimatedTicks);
        new void Progress(int dwTranspiredTicks);
        new void End();
        new void End2(int hrCompletionCode);

        void Begin3(Guid EventId, int dwEstimatedTicks, IntPtr pContext);
        void Progress3(Guid EventId, int dwTranspiredTicks, IntPtr pContext);
        void End3(Guid EventId, int hrCompletionCode, IntPtr pContext);
    };

    [ComImport, Guid("97717EEA-926A-464e-96A4-247B0216026E"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMStorage3 : IWMDMStorage2
    {
        new void SetAttributes(uint dwAttributes, ref _tWAVEFORMATEX pFormat);
        new void GetStorageGlobals(out WMDMStorageGlobal ppStorageGlobals);
        new void GetAttributes(out uint pdwAttributes, ref _tWAVEFORMATEX pFormat);
        new void GetName(StringBuilder pwszName, uint nMaxChars);
        new void GetDate(out _WMDMDATETIME pDateTimeUTC);
        new void GetSize(out uint pdwSizeLow, out uint pdwSizeHigh);
        new void GetRights(IntPtr ppRights, out uint pnRightsCount, [MarshalAs(UnmanagedType.LPArray)]byte[] abMac);
        new void EnumStorage(out WMDMStorageEnum pEnumStorage);
        new void SendOpaqueCommand(ref __OPAQUECOMMAND pCommand);

        new void GetStorage(String pszStorageName, out WMDMStorage ppStorage);
        new void SetAttributes2(WMDM_STORAGE_ATTR dwAttributes, uint dwAttributesEx, ref _WAVEFORMATEX pFormat, ref _VIDEOINFOHEADER pVideoFormat);
        new void GetAttributes2(out WMDM_STORAGE_ATTR pdwAttributes, out uint pdwAttributesEx, out _WAVEFORMATEX pAudioFormat, out _VIDEOINFOHEADER pVideoFormat);

        void GetMetadata(out IWMDMMetaData ppMetadata);
        void SetMetadata(IWMDMMetaData pMetadata);
        void CreateEmptyMetadataObject(out IWMDMMetaData ppMetadata);
        void SetEnumPreference(out WMDM_STORAGE_ENUM_MODE pMode, uint nViews, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] WMDMMetadataView[] pViews);
    };

    [ComImport, Guid("C225BAC5-A03A-40B8-9A23-91CF478C64A6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMStorage4 : IWMDMStorage3
    {
        new void SetAttributes(uint dwAttributes, ref _tWAVEFORMATEX pFormat);
        new void GetStorageGlobals(out WMDMStorageGlobal ppStorageGlobals);
        new void GetAttributes(out uint pdwAttributes, ref _tWAVEFORMATEX pFormat);
        new void GetName(StringBuilder pwszName, uint nMaxChars);
        new void GetDate(out _WMDMDATETIME pDateTimeUTC);
        new void GetSize(out uint pdwSizeLow, out uint pdwSizeHigh);
        new void GetRights(IntPtr ppRights, out uint pnRightsCount, [MarshalAs(UnmanagedType.LPArray)] byte[] abMac);
        new void EnumStorage(out WMDMStorageEnum pEnumStorage);
        new void SendOpaqueCommand(ref __OPAQUECOMMAND pCommand);

        new void GetStorage(String pszStorageName, out WMDMStorage ppStorage);
        new void SetAttributes2(WMDM_STORAGE_ATTR dwAttributes, uint dwAttributesEx, ref _WAVEFORMATEX pFormat, ref _VIDEOINFOHEADER pVideoFormat);
        new void GetAttributes2(out WMDM_STORAGE_ATTR pdwAttributes, out uint pdwAttributesEx, out _WAVEFORMATEX pAudioFormat, out _VIDEOINFOHEADER pVideoFormat);

        new void GetMetadata(out IWMDMMetaData ppMetadata);
        new void SetMetadata(IWMDMMetaData pMetadata);
        new void CreateEmptyMetadataObject(out IWMDMMetaData ppMetadata);
        new void SetEnumPreference(out WMDM_STORAGE_ENUM_MODE pMode, uint nViews, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)]WMDMMetadataView[] pViews);


        void SetReferences(int dwRefs, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] IWMDMStorage[] ppIWMDMStorage);
        void GetReferences(out int pdwRefs, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] out IWMDMStorage[] pppIWMDMStorage);
        void GetRightsWithProgress(IWMDMProgress3 pIProgressCallback, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] out WMDMRIGHTS[] ppRights, out int pnRightsCount);
        void GetSpecifiedMetadata(int cProperties, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] string[] ppwszPropNames, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)]out IWMDMMetaData[] ppMetadata);
        void FindStorage(WMDM_FIND_SCOPE findScope, string pwszUniqueID, out IWMDMStorage ppStorage);
        [PreserveSig]
        int GetParent(out IWMDMStorage ppStorage);
    };

    [ComImport, Guid("1DCB3A0B-33ED-11d3-8470-00C04F79DBC0"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMOperation
    {
        void BeginRead();
        void BeginWrite();
        void GetObjectName(StringBuilder pwszName, int nMaxChars);
        void SetObjectName(String pwszName, int nMaxChars);
        void GetObjectAttributes(out WMDM_STORAGE_ATTR pdwAttributes, /*out _WAVEFORMATEX*/ IntPtr pFormat);
        void SetObjectAttributes(WMDM_STORAGE_ATTR dwAttributes, /*ref _WAVEFORMATEX*/ IntPtr pFormat);
        void GetObjectTotalSize(out uint pdwSizeLow, out uint pdwSizeHigh);
        void SetObjectTotalSize(uint dwSize, uint dwSizeHigh);
        [PreserveSig]
        int TransferObjectData([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), In, Out]byte[] pData, ref int pdwSize, [MarshalAs(UnmanagedType.LPArray, SizeConst = 8), In, Out]byte[] abMac);
        void End(ref uint phCompletionCode, [MarshalAs(UnmanagedType.IUnknown)] object pNewObject);
    };

    [ComImport, Guid("33445B48-7DF7-425c-AD8F-0FC6D82F9F75"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMOperation2 : IWMDMOperation
    {
        new void BeginRead();
        new void BeginWrite();
        new void GetObjectName(StringBuilder pwszName, int nMaxChars);
        new void SetObjectName(String pwszName, int nMaxChars);
        new void GetObjectAttributes(out WMDM_STORAGE_ATTR pdwAttributes, /*out _WAVEFORMATEX*/ IntPtr pFormat);
        new void SetObjectAttributes(WMDM_STORAGE_ATTR dwAttributes, /*ref _WAVEFORMATEX*/ IntPtr pFormat);
        new void GetObjectTotalSize(out uint pdwSizeLow, out uint pdwSizeHigh);
        new void SetObjectTotalSize(uint dwSize, uint dwSizeHigh);
        [PreserveSig]
        new int TransferObjectData([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), In, Out]byte[] pData, ref int pdwSize, [MarshalAs(UnmanagedType.LPArray, SizeConst = 8), In, Out]byte[] abMac);
        new void End(ref uint phCompletionCode, [MarshalAs(UnmanagedType.IUnknown)] object pNewObject);

        void SetObjectAttributes2(uint dwAttributes, uint dwAttributesEx, /*ref _WAVEFORMATEX*/ IntPtr pFormat, /*ref _VIDEOINFOHEADER*/ IntPtr pVideoFormat);
        void GetObjectAttributes2(out uint pdwAttributes, out uint pdwAttributesEx, /*out  _WAVEFORMATEX*/ IntPtr pAudioFormat, /*out _VIDEOINFOHEADER*/ IntPtr pVideoFormat);
    };

    [ComImport, Guid("d1f9b46a-9ca8-46d8-9d0f-1ec9bae54919"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMOperation3 : IWMDMOperation
    {
        new void BeginRead();
        new void BeginWrite();
        new void GetObjectName([MarshalAs(UnmanagedType.LPWStr, SizeParamIndex=1)]StringBuilder pwszName, int nMaxChars);
        new void SetObjectName(String pwszName, int nMaxChars);
        new void GetObjectAttributes(out WMDM_STORAGE_ATTR pdwAttributes, /*out _WAVEFORMATEX*/ IntPtr pFormat);
        new void SetObjectAttributes(WMDM_STORAGE_ATTR dwAttributes, /*ref _WAVEFORMATEX*/ IntPtr pFormat);
        new void GetObjectTotalSize(out uint pdwSizeLow, out uint pdwSizeHigh);
        new void SetObjectTotalSize(uint dwSize, uint dwSizeHigh);
        [PreserveSig]
        new int TransferObjectData([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), In, Out] byte[] pData, ref int pdwSize, [MarshalAs(UnmanagedType.LPArray, SizeConst = 8), In, Out] byte[] abMac);
        new void End(ref uint phCompletionCode, [MarshalAs(UnmanagedType.IUnknown)] object pNewObject);

        [PreserveSig]
        int TransferObjectDataOnClearChannel([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), In, Out] byte[] pData, ref int pdwSize);
    };


    [ComImport, Guid("1DCB3A08-33ED-11d3-8470-00C04F79DBC0"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMStorageControl
    {
        void Insert(uint fuMode, String pwszFile, IWMDMOperation pOperation, IWMDMProgress pProgress, out WMDMStorage ppNewObject);
        void Delete(uint fuMode, IWMDMProgress pProgress);
        void Rename(uint fuMode, String pwszNewName, IWMDMProgress pProgress);
        void Read(uint fuMode, String pwszFile, IWMDMProgress pProgress, IWMDMOperation pOperation);
        void Move(uint fuMode, IWMDMStorage pTargetObject, IWMDMProgress pProgress);
    };

    [ComImport, Guid("972C2E88-BD6C-4125-8E09-84F837E637B6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMStorageControl2 : IWMDMStorageControl
    {
        new void Insert(uint fuMode, String pwszFile, IWMDMOperation pOperation, IWMDMProgress pProgress, out WMDMStorage ppNewObject);
        new void Delete(uint fuMode, IWMDMProgress pProgress);
        new void Rename(uint fuMode, String pwszNewName, IWMDMProgress pProgress);
        new void Read(uint fuMode, String pwszFile, IWMDMProgress pProgress, IWMDMOperation pOperation);
        new void Move(uint fuMode, IWMDMStorage pTargetObject, IWMDMProgress pProgress);

        void Insert2(uint fuMode, String pwszFileSource, String pwszFileDest, IWMDMOperation pOperation, IWMDMProgress pProgress, object pUnknown, out WMDMStorage ppNewObject);
    };

    [ComImport, Guid("B3266365-D4F3-4696-8D53-BD27EC60993A"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IWMDMStorageControl3 : IWMDMStorageControl2
    {
        new void Insert(uint fuMode, String pwszFile, IWMDMOperation pOperation, IWMDMProgress pProgress, out WMDMStorage ppNewObject);
        new void Delete(uint fuMode, IWMDMProgress pProgress);
        new void Rename(uint fuMode, String pwszNewName, IWMDMProgress pProgress);
        new void Read(uint fuMode, String pwszFile, IWMDMProgress pProgress, IWMDMOperation pOperation);
        new void Move(uint fuMode, IWMDMStorage pTargetObject, IWMDMProgress pProgress);

        new void Insert2(uint fuMode, String pwszFileSource, String pwszFileDest, IWMDMOperation pOperation, IWMDMProgress pProgress, [MarshalAs(UnmanagedType.IUnknown)]  object pUnknown, out WMDMStorage ppNewObject);

        void Insert3(uint fuMode, WMDM_STORAGE_ATTR fuType, String pwszFileSource, String pwszFileDest, IWMDMOperation pOperation, IWMDMProgress pProgress, IWMDMMetaData pMetaData, [MarshalAs(UnmanagedType.IUnknown)]  object pUnknown, out WMDMStorage ppNewObject);
    };
}
